<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="crm.model.Customer"%>
<%@page import="crm.model.Linkman"%>
<%@page import="crm.model.Salearea"%>
<%@page import="crm.util.ParamUtil"%>
<%@page import="java.util.*"%>
<%@page import="crm.control.CustomerControl"%>
<%@page import="crm.control.LinkmanControl"%>
<%@page import="crm.control.SaleareaControl"%>
<%@page import="crm.util.GetBaseParam"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../resources/css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../resources/css/inner.css" type="text/css" media="screen" />
<style type='text/css'>
 a{font-size:12px; text-decoration:none; color:#70B300;}
</style>
		<title>linkman_update</title>
	</head>
	<script type="text/javascript" src="../../../resources/js/WebCalendar.js">
</script>
	<body>
		<%
			request.setCharacterEncoding("UTF-8");
			int id = Integer.parseInt(request.getParameter("id"));
			//System.out.print(id);
			Linkman linkman = new Linkman();
			
			linkman=LinkmanControl.getLinkmanById(id);
			ArrayList linkmans=LinkmanControl.getAllLinkmans();
			
			
		%>
		<form action="linkman_update_do.jsp?id=<%=id%>" method="post">
			<table>
				<tr>
					<td>
						联系人姓名
					</td>
					<td>
						<input type="text" name="name"
							value="<%=linkman.getName()%>" />
					</td>
				</tr>
				<tr>
					<td>
						性别
					</td>
					<td >
									 
									 <input type="radio" name="gender" value="1"
										<% if(linkman.getGender()!=null) if(linkman.getGender().equals("1")) out.println("checked"); %>>
									男
									<input type="radio" name="gender" value="0"
										<% if(linkman.getGender()!=null) if(linkman.getGender().equals("0")) out.println("checked"); %>>
									女								
					</td>
				</tr>
			
				<tr>
					<td>
					       生日
					</td>
					<td>
						<input type="text" name="birthday" maxlength="20"
							onClick="SelectDate(this,'yyyy-MM-dd')"
							value="<%=linkman.getBirthday()%>" />
					</td>
				</tr>
				<tr>
				<td>
						籍贯
				</td>
					<td >
							<select name="province_id" id="province_id" >
										<%
												HashMap provinces = GetBaseParam.getAllProvinces();
												Iterator it1 = provinces.entrySet().iterator();
											   while (it1.hasNext()) {
									              Map.Entry entry = (Map.Entry) it1.next();
										%>
										<option value="<%=entry.getKey()%>"
											<%if (entry.getKey().equals(linkman.getProvince())) out.println("selected");%>>
											<%=entry.getValue()%>										</option>
										<%
										}
										%>
									</select>																	</td>
				</tr>
				<tr>
					<td>
						职位
					</td>
					<td>
						<input type="text" name="position"
							value="<%=linkman.getPosition()%>" />
					</td>
				</tr>
				<tr>
					<td>
						邮件
					</td>
					<td>
						<input type="text" name="email"
							value="<%=linkman.getEmail()%>" />
					</td>
				</tr>
				<tr>
					<td>
						联系号码
					</td>
					<td>
						<input type="text" name="phone"
							value="<%=linkman.getPhone()%>" />
					</td>
				</tr>
				<tr>
					<td>
						爱好
					</td>
					<td>
						<input type="text" name="hobby"
							value="<%=linkman.getHobby()%>" />
					</td>
				</tr>
				<tr>
					<td>
					qq号
					</td>
					<td>
						<input type="text" name="qq" value="<%=linkman.getQq()%>" />
					</td>
				</tr>
				<tr>
					<td colspan='2' style='text-align: center;'>
						<input type="submit" id="submit" class='button' value="提交" />
					</td>
					
				</tr>
			</table>
		</form>
	</body>
</html>